<template>
	<BaseContainer>
		<aplid-base-crud
			ref="crud"
			class="w-100"
			v-bind="baseConfig"
			:paramsObj="{
				year: nowRowData.year,
				month: nowRowData.month,
				creditCode: queryObj.creditCode,
			}"
		>
      <template v-slot:ArchivesDialog="{ row, show }">
        <Archives @refresh="handleRefresh" :api="baseConfig.api" v-if="show" :nowRowData="row">
        </Archives>
      </template>
		</aplid-base-crud>
	</BaseContainer>
</template>

<script setup lang="ts">
import { baseConfig } from './config'
import { useCommonStore } from '@/stores/common'
import apiMod from '@/apiMod/index'
import Archives from './Archives/index.vue'

const { queryObj } = storeToRefs(useCommonStore())

type Props = {
	nowRowData?: any
}
const props = withDefaults(defineProps<Props>(), {})
const crud = ref(null)

const handleRefresh = (query?: any, visible = false) => {
  nextTick(() => {
    crud.value?.refreshChange(query)
  })
}

</script>

<style lang="scss" scoped>
.text-title {
	font-weight: 600;
	font-size: 18px;
}
.text-label {
	display: flex;
	align-items: center;
}
.text-value {
	font-weight: 600;
	font-size: 24px;
}
</style>
